package com.qq.mall.controller;


import com.qq.mall.beans.ProductSku;
import com.qq.mall.service.ProductSkuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@RestController
@RequestMapping("/retaildemo/product-sku")
@Api(tags = "商品Sku")
public class ProductSkuController {
    @Autowired
    ProductSkuService productSkuService;
    @GetMapping("/SkuGet")
    @ApiOperation("查询所有商品的SKU")
    public List<ProductSku> SkuGet(){
        return this.productSkuService.list();
    }
    @PostMapping("/addSku")
    @ApiOperation("给商品添加一个sku")
    public boolean addsku(@RequestBody ProductSku productSku){
        return productSkuService.save(productSku);
    }
}

